# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1078.1.8 -> 1.1078.1.9 # kernel/ksyms.c 1.195 -> 1.196 # kernel/fork.c 1.118 -> 1.119 # include/linux/sched.h 1.142 -> 1.143 # kernel/sys.c 1.43 -> 1.44 # kernel/softirq.c 1.39 -> 1.40 # include/linux/nfs_fs.h 1.45 -> 1.46 # include/linux/irq.h 1.6 -> 1.7 # usr/Makefile 1.6 -> 1.7 # include/linux/smp.h 1.22 -> 1.23 # Makefile 1.405 -> 1.406 # include/linux/highmem.h 1.25 -> 1.26 # include/linux/percpu.h 1.5 -> 1.6 # include/linux/irq_cpustat.h 1.7 -> 1.8 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/05/14 davidm@tiger.hpl.hp.com 1.1078.1.9 # Minor build fixes/enhancements. # -------------------------------------------- # diff -Nru a/Makefile b/Makefile --- a/Makefile Thu May 15 13:41:43 2003 +++ b/Makefile Thu May 15 13:41:43 2003 @@ -182,7 +182,7 @@ NOSTDINC_FLAGS = -nostdinc -iwithprefix include CPPFLAGS := -D__KERNEL__ -Iinclude -CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ +CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -g -O2 \ -fno-strict-aliasing -fno-common AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS) diff -Nru a/include/linux/highmem.h b/include/linux/highmem.h --- a/include/linux/highmem.h Thu May 15 13:41:43 2003 +++ b/include/linux/highmem.h Thu May 15 13:41:43 2003 @@ -3,6 +3,8 @@ #include #include +#include + #include #ifdef CONFIG_HIGHMEM diff -Nru a/include/linux/irq.h b/include/linux/irq.h --- a/include/linux/irq.h Thu May 15 13:41:43 2003 +++ b/include/linux/irq.h Thu May 15 13:41:43 2003 @@ -56,15 +56,13 @@ * * Pad this out to 32 bytes for cache and indexing reasons. */ -typedef struct { +typedef struct irq_desc { unsigned int status; /* IRQ status */ hw_irq_controller *handler; struct irqaction *action; /* IRQ action list */ unsigned int depth; /* nested irq disables */ spinlock_t lock; } ____cacheline_aligned irq_desc_t; - -extern irq_desc_t irq_desc [NR_IRQS]; #include /* the arch dependent stuff */ diff -Nru a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h --- a/include/linux/irq_cpustat.h Thu May 15 13:41:43 2003 +++ b/include/linux/irq_cpustat.h Thu May 15 13:41:43 2003 @@ -24,7 +24,7 @@ #define __IRQ_STAT(cpu, member) (irq_stat[cpu].member) #else #define __IRQ_STAT(cpu, member) ((void)(cpu), irq_stat[0].member) -#endif +#endif #endif /* arch independent irq_stat fields */ @@ -34,5 +34,10 @@ #define ksoftirqd_task(cpu) __IRQ_STAT((cpu), __ksoftirqd_task) /* arch dependent irq_stat fields */ #define nmi_count(cpu) __IRQ_STAT((cpu), __nmi_count) /* i386, ia64 */ + +#define local_softirq_pending() softirq_pending(smp_processor_id()) +#define local_syscall_count() syscall_count(smp_processor_id()) +#define local_ksoftirqd_task() ksoftirqd_task(smp_processor_id()) +#define local_nmi_count() nmi_count(smp_processor_id()) #endif /* __irq_cpustat_h */ diff -Nru a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h --- a/include/linux/nfs_fs.h Thu May 15 13:41:43 2003 +++ b/include/linux/nfs_fs.h Thu May 15 13:41:43 2003 @@ -408,7 +408,7 @@ nfs_size_to_loff_t(__u64 size) { loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1; - if (size > maxsz) + if (size > (__u64) maxsz) return maxsz; return (loff_t) size; } diff -Nru a/include/linux/percpu.h b/include/linux/percpu.h --- a/include/linux/percpu.h Thu May 15 13:41:43 2003 +++ b/include/linux/percpu.h Thu May 15 13:41:43 2003 @@ -1,9 +1,8 @@ #ifndef __LINUX_PERCPU_H #define __LINUX_PERCPU_H -#include /* For preempt_disable() */ +#include /* For preempt_disable() */ #include /* For kmalloc_percpu() */ #include - /* Must be an lvalue. */ #define get_cpu_var(var) (*({ preempt_disable(); &__get_cpu_var(var); })) #define put_cpu_var(var) preempt_enable() diff -Nru a/include/linux/sched.h b/include/linux/sched.h --- a/include/linux/sched.h Thu May 15 13:41:43 2003 +++ b/include/linux/sched.h Thu May 15 13:41:43 2003 @@ -148,8 +148,8 @@ extern void init_idle(task_t *idle, int cpu); extern void show_state(void); -extern void show_trace(unsigned long *stack); -extern void show_stack(unsigned long *stack); +extern void show_trace(struct task_struct *); +extern void show_stack(struct task_struct *); extern void show_regs(struct pt_regs *); void io_schedule(void); @@ -496,14 +496,14 @@ #ifndef INIT_THREAD_SIZE # define INIT_THREAD_SIZE 2048*sizeof(long) -#endif - union thread_union { struct thread_info thread_info; unsigned long stack[INIT_THREAD_SIZE/sizeof(long)]; }; extern union thread_union init_thread_union; +#endif + extern struct task_struct init_task; extern struct mm_struct init_mm; diff -Nru a/include/linux/smp.h b/include/linux/smp.h --- a/include/linux/smp.h Thu May 15 13:41:43 2003 +++ b/include/linux/smp.h Thu May 15 13:41:43 2003 @@ -74,10 +74,6 @@ */ extern int smp_threads_ready; -extern volatile unsigned long smp_msg_data; -extern volatile int smp_src_cpu; -extern volatile int smp_msg_id; - #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ #define MSG_ALL 0x8001 diff -Nru a/kernel/fork.c b/kernel/fork.c --- a/kernel/fork.c Thu May 15 13:41:43 2003 +++ b/kernel/fork.c Thu May 15 13:41:43 2003 @@ -38,8 +38,6 @@ #include #include -static kmem_cache_t *task_struct_cachep; - extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk); extern void exit_semundo(struct task_struct *tsk); @@ -55,13 +53,6 @@ rwlock_t tasklist_lock __cacheline_aligned = RW_LOCK_UNLOCKED; /* outer */ -/* - * A per-CPU task cache - this relies on the fact that - * the very last portion of sys_exit() is executed with - * preemption turned off. - */ -static task_t *task_cache[NR_CPUS] __cacheline_aligned; - int nr_processes(void) { int cpu; @@ -74,6 +65,22 @@ return total; } +#ifdef CONFIG_IA64 +# define HAVE_ARCH_DUP_TASK_STRUCT +#endif + +#ifdef HAVE_ARCH_DUP_TASK_STRUCT +extern void free_task_struct (struct task_struct *tsk); +#else +static kmem_cache_t *task_struct_cachep; + +/* + * A per-CPU task cache - this relies on the fact that + * the very last portion of sys_exit() is executed with + * preemption turned off. + */ +static task_t *task_cache[NR_CPUS] __cacheline_aligned; + static void free_task_struct(struct task_struct *tsk) { /* @@ -97,6 +104,7 @@ put_cpu(); } } +#endif /* HAVE_ARCH_DUP_TASK_STRUCT */ void __put_task_struct(struct task_struct *tsk) { @@ -186,6 +194,7 @@ void __init fork_init(unsigned long mempages) { +#ifndef HAVE_ARCH_DUP_TASK_STRUCT /* create a slab on which task_structs can be allocated */ task_struct_cachep = kmem_cache_create("task_struct", @@ -193,6 +202,7 @@ SLAB_MUST_HWCACHE_ALIGN, NULL, NULL); if (!task_struct_cachep) panic("fork_init(): cannot create task_struct SLAB cache"); +#endif /* * The default maximum number of threads is set to a safe @@ -210,7 +220,11 @@ init_task.rlim[RLIMIT_NPROC].rlim_max = max_threads/2; } -static struct task_struct *dup_task_struct(struct task_struct *orig) +#ifdef HAVE_ARCH_DUP_TASK_STRUCT +extern struct task_struct *dup_task_struct (struct task_struct *orig); +#else /* !HAVE_ARCH_DUP_TASK_STRUCT */ + +struct task_struct *dup_task_struct(struct task_struct *orig) { struct task_struct *tsk; struct thread_info *ti; @@ -244,6 +258,8 @@ return tsk; } +#endif /* !HAVE_ARCH_DUP_TASK_STRUCT */ + #ifdef CONFIG_MMU static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm) { @@ -884,11 +900,15 @@ if (clone_flags & CLONE_CHILD_SETTID) p->set_child_tid = child_tidptr; + else + p->set_child_tid = NULL; /* * Clear TID on mm_release()? */ if (clone_flags & CLONE_CHILD_CLEARTID) p->clear_child_tid = child_tidptr; + else + p->clear_child_tid = NULL; /* * Syscall tracing should be turned off in the child regardless diff -Nru a/kernel/ksyms.c b/kernel/ksyms.c --- a/kernel/ksyms.c Thu May 15 13:41:43 2003 +++ b/kernel/ksyms.c Thu May 15 13:41:43 2003 @@ -402,7 +402,9 @@ EXPORT_SYMBOL(del_timer); EXPORT_SYMBOL(request_irq); EXPORT_SYMBOL(free_irq); +#if !defined(CONFIG_IA64) EXPORT_SYMBOL(irq_stat); +#endif /* waitqueue handling */ EXPORT_SYMBOL(add_wait_queue); @@ -602,7 +604,9 @@ /* init task, for moving kthread roots - ought to export a function ?? */ EXPORT_SYMBOL(init_task); +#ifndef CONFIG_IA64 EXPORT_SYMBOL(init_thread_union); +#endif EXPORT_SYMBOL(tasklist_lock); EXPORT_SYMBOL(find_task_by_pid); diff -Nru a/kernel/softirq.c b/kernel/softirq.c --- a/kernel/softirq.c Thu May 15 13:41:43 2003 +++ b/kernel/softirq.c Thu May 15 13:41:43 2003 @@ -33,7 +33,10 @@ - Tasklets: serialized wrt itself. */ +/* No separate irq_stat for ia64, it is part of PSA */ +#if !defined(CONFIG_IA64) irq_cpustat_t irq_stat[NR_CPUS] ____cacheline_aligned; +#endif /* CONFIG_IA64 */ static struct softirq_action softirq_vec[32] __cacheline_aligned_in_smp; @@ -321,7 +324,7 @@ __set_current_state(TASK_INTERRUPTIBLE); mb(); - ksoftirqd_task(cpu) = current; + local_ksoftirqd_task() = current; for (;;) { if (!local_softirq_pending()) diff -Nru a/kernel/sys.c b/kernel/sys.c --- a/kernel/sys.c Thu May 15 13:41:43 2003 +++ b/kernel/sys.c Thu May 15 13:41:43 2003 @@ -1218,7 +1218,7 @@ ? -EFAULT : 0; } -#if !defined(__ia64__) && !defined(CONFIG_V850) +#if (!defined(__ia64__) && !defined(CONFIG_V850)) || defined(CONFIG_COMPAT) /* * Back compatibility for getrlimit. Needed for some apps. diff -Nru a/usr/Makefile b/usr/Makefile --- a/usr/Makefile Thu May 15 13:41:43 2003 +++ b/usr/Makefile Thu May 15 13:41:43 2003 @@ -5,11 +5,9 @@ clean-files := initramfs_data.cpio.gz -LDFLAGS_initramfs_data.o := $(LDFLAGS_BLOB) -r -T - -$(obj)/initramfs_data.o: $(src)/initramfs_data.scr \ - $(obj)/initramfs_data.cpio.gz FORCE - $(call if_changed,ld) +$(obj)/initramfs_data.S: $(obj)/initramfs_data.cpio.gz + echo '.section ".init.ramfs", "a"' > $@ + od -v -An -t x1 -w8 $^ | cut -c2- | sed -e s"/ /,0x/g" -e s"/^/.byte 0x"/ >> $@ # initramfs-y are the programs which will be copied into the CPIO # archive. Currently, the filenames are hardcoded in gen_init_cpio,